﻿using System.Web.Mvc;
using System.Web.Routing;

namespace Quintsys.Core.Extensions
{
    public static class RouteExtensions
    {
        /// <summary>
        /// Adds the default ignored routes.
        /// </summary>
        /// <param name="routes">The routes.</param>
        public static void AddDefaultIgnoredRoutes(this RouteCollection routes)
        {
            routes.IgnoreRoute("{file}.txt");
            routes.IgnoreRoute("{file}.htm");
            routes.IgnoreRoute("{file}.html");
            routes.IgnoreRoute("{file}.pdf");
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("content/{*pathInfo}");
            routes.IgnoreRoute("scripts/{*pathInfo}");
            routes.IgnoreRoute("{*favicon}", new
            {
                favicon = @"(.*/)?favicon.([iI][cC][oO]|[gG][iI][fF])(/.*)?"
            });
        }
    }
}
